home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / bc-1_02.lha / bc-1.02 / scan.c.dist < prev    next >
Text File  |  1992-03-04  |  36KB  |  1,369 lines

  1. /* A lexical scanner generated by flex */
  2.  
  3. /* scanner skeleton version:
  4.  * $Header: /usr/fsys/odin/a/vern/flex/RCS/flex.skel,v 2.16 90/08/03 14:09:36 vern Exp $
  5.  */
  6.  
  7. #define FLEX_SCANNER
  8.  
  9. #include <stdio.h>
  10.  
  11.  
  12. /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
  13. #ifdef c_plusplus
  14. #ifndef __cplusplus
  15. #define __cplusplus
  16. #endif
  17. #endif
  18.  
  19.  
  20. #ifdef __cplusplus
  21.  
  22. #include <stdlib.h>
  23. #include <osfcn.h>
  24.  
  25. /* use prototypes in function declarations */
  26. #define YY_USE_PROTOS
  27.  
  28. /* the "const" storage-class-modifier is valid */
  29. #define YY_USE_CONST
  30.  
  31. #else    /* ! __cplusplus */
  32.  
  33. #ifdef __STDC__
  34.  
  35. #ifdef __GNUC__
  36. #include <stddef.h>
  37. void *malloc( size_t );
  38. void free( void* );
  39. #else
  40. #include <stdlib.h>
  41. #endif    /* __GNUC__ */
  42.  
  43. #define YY_USE_PROTOS
  44. #define YY_USE_CONST
  45.  
  46. #endif    /* __STDC__ */
  47. #endif    /* ! __cplusplus */
  48.  
  49.  
  50. #ifdef __TURBOC__
  51. #define YY_USE_CONST
  52. #endif
  53.  
  54.  
  55. #ifndef YY_USE_CONST
  56. #define const
  57. #endif
  58.  
  59.  
  60. #ifdef YY_USE_PROTOS
  61. #define YY_PROTO(proto) proto
  62. #else
  63. #define YY_PROTO(proto) ()
  64. /* we can't get here if it's an ANSI C compiler, or a C++ compiler,
  65.  * so it's got to be a K&R compiler, and therefore there's no standard
  66.  * place from which to include these definitions
  67.  */
  68. /* char *malloc();
  69. int free(); */
  70. int read();
  71. #endif
  72.  
  73.  
  74. /* amount of stuff to slurp up with each read */
  75. #ifndef YY_READ_BUF_SIZE
  76. #define YY_READ_BUF_SIZE 8192
  77. #endif
  78.  
  79. /* returned upon end-of-file */
  80. #define YY_END_TOK 0
  81.  
  82. /* copy whatever the last rule matched to the standard output */
  83.  
  84. /* cast to (char *) is because for 8-bit chars, yytext is (unsigned char *) */
  85. /* this used to be an fputs(), but since the string might contain NUL's,
  86.  * we now use fwrite()
  87.  */
  88. #define ECHO (void) fwrite( (char *) yytext, yyleng, 1, yyout )
  89.  
  90. /* gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
  91.  * is returned in "result".
  92.  */
  93. #define YY_INPUT(buf,result,max_size) \
  94.     if ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
  95.         YY_FATAL_ERROR( "read() in flex scanner failed" );
  96. #define YY_NULL 0
  97.  
  98. /* no semi-colon after return; correct usage is to write "yyterminate();" -
  99.  * we don't want an extra ';' after the "return" because that will cause
  100.  * some compilers to complain about unreachable statements.
  101.  */
  102. #define yyterminate() return ( YY_NULL )
  103.  
  104. /* report a fatal error */
  105.  
  106. /* The funky do-while is used to turn this macro definition into
  107.  * a single C statement (which needs a semi-colon terminator).
  108.  * This avoids problems with code like:
  109.  *
  110.  *     if ( something_happens )
  111.  *        YY_FATAL_ERROR( "oops, the something happened" );
  112.  *    else
  113.  *        everything_okay();
  114.  *
  115.  * Prior to using the do-while the compiler would get upset at the
  116.  * "else" because it interpreted the "if" statement as being all
  117.  * done when it reached the ';' after the YY_FATAL_ERROR() call.
  118.  */
  119.  
  120. #define YY_FATAL_ERROR(msg) \
  121.     do \
  122.         { \
  123.         (void) fputs( msg, stderr ); \
  124.         (void) putc( '\n', stderr ); \
  125.         exit( 1 ); \
  126.         } \
  127.     while ( 0 )
  128.  
  129. /* default yywrap function - always treat EOF as an EOF */
  130. #define yywrap() 1
  131.  
  132. /* enter a start condition.  This macro really ought to take a parameter,
  133.  * but we do it the disgusting crufty way forced on us by the ()-less
  134.  * definition of BEGIN
  135.  */
  136. #define BEGIN yy_start = 1 + 2 *
  137.  
  138. /* action number for EOF rule of a given start state */
  139. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  140.  
  141. /* special action meaning "start processing a new file" */
  142. #define YY_NEW_FILE \
  143.     do \
  144.         { \
  145.         yy_init_buffer( yy_current_buffer, yyin ); \
  146.         yy_load_buffer_state(); \
  147.         } \
  148.     while ( 0 )
  149.  
  150. /* default declaration of generated scanner - a define so the user can
  151.  * easily add parameters
  152.  */
  153. #define YY_DECL int yylex YY_PROTO(( void )) 
  154.  
  155. /* code executed at the end of each rule */
  156. #define YY_BREAK break;
  157.  
  158. #define YY_END_OF_BUFFER_CHAR 0
  159.  
  160. #ifndef YY_BUF_SIZE
  161. #define YY_BUF_SIZE (YY_READ_BUF_SIZE * 2) /* size of default input buffer */
  162. #endif
  163.  
  164. typedef struct yy_buffer_state *YY_BUFFER_STATE;
  165.  
  166. #define YY_CHAR unsigned char
  167. # line 1 "scan.l"
  168. #define INITIAL 0
  169. # line 2 "scan.l"
  170. /* scan.l: the (f)lex description file for the scanner. */
  171.  
  172. /*  This file is part of bc written for MINIX.
  173.     Copyright (C) 1991, 1992 Free Software Foundation, Inc.
  174.  
  175.     This program is free software; you can redistribute it and/or modify
  176.     it under the terms of the GNU General Public License as published by
  177.     the Free Software Foundation; either version 2 of the License , or
  178.     (at your option) any later version.
  179.  
  180.     This program is distributed in the hope that it will be useful,
  181.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  182.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  183.     GNU General Public License for more details.
  184.  
  185.     You should have received a copy of the GNU General Public License
  186.     along with this program; see the file COPYING.  If not, write to
  187.     the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  188.  
  189.     You may contact the author by:
  190.        e-mail:  phil@cs.wwu.edu
  191.       us-mail:  Philip A. Nelson
  192.                 Computer Science Department, 9062
  193.                 Western Washington University
  194.                 Bellingham, WA 98226-9062
  195.        
  196. *************************************************************************/
  197.  
  198. #include "bcdefs.h"
  199. #include "y.tab.h"
  200. #include "global.h"
  201. #include "proto.h"
  202.  
  203. /* Using flex, we can ask for a smaller input buffer.  With lex, this
  204.    does nothing! */
  205.  
  206. #ifdef SMALL_BUF
  207. #undef YY_READ_BUF_SIZE
  208. #define YY_READ_BUF_SIZE 512
  209. #endif
  210.  
  211. /* We want to define our own yywrap. */
  212. #undef yywrap
  213. _PROTOTYPE(int yywrap, (void));
  214.  
  215. /* MINIX returns from read with < 0 if SIGINT is  encountered.
  216.    In flex, we can redefine YY_INPUT to the following.  In lex, this
  217.    does nothing! */
  218. #include <errno.h>
  219. #undef  YY_INPUT
  220. #define YY_INPUT(buf,result,max_size) \
  221.     while ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
  222.         if (errno != EINTR) \
  223.         YY_FATAL_ERROR( "read() in flex scanner failed" );
  224.  
  225. # line 60 "scan.l"
  226.  
  227. /* done after the current pattern has been matched and before the
  228.  * corresponding action - sets up yytext
  229.  */
  230. #define YY_DO_BEFORE_ACTION \
  231.     yytext = yy_bp; \
  232.     yyleng = yy_cp - yy_bp; \
  233.     yy_hold_char = *yy_cp; \
  234.     *yy_cp = '\0'; \
  235.     yy_c_buf_p = yy_cp;
  236.  
  237. #define EOB_ACT_CONTINUE_SCAN 0
  238. #define EOB_ACT_END_OF_FILE 1
  239. #define EOB_ACT_LAST_MATCH 2
  240.  
  241. /* return all but the first 'n' matched characters back to the input stream */
  242. #define yyless(n) \
  243.     do \
  244.         { \
  245.         /* undo effects of setting up yytext */ \
  246.         *yy_cp = yy_hold_char; \
  247.         yy_c_buf_p = yy_cp = yy_bp + n; \
  248.         YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  249.         } \
  250.     while ( 0 )
  251.  
  252. #define unput(c) yyunput( c, yytext )
  253.  
  254.  
  255. struct yy_buffer_state
  256.     {
  257.     FILE *yy_input_file;
  258.  
  259.     YY_CHAR *yy_ch_buf;        /* input buffer */
  260.     YY_CHAR *yy_buf_pos;    /* current position in input buffer */
  261.  
  262.     /* size of input buffer in bytes, not including room for EOB characters*/
  263.     int yy_buf_size;    
  264.  
  265.     /* number of characters read into yy_ch_buf, not including EOB characters */
  266.     int yy_n_chars;
  267.  
  268.     int yy_eof_status;        /* whether we've seen an EOF on this buffer */
  269. #define EOF_NOT_SEEN 0
  270.     /* "pending" happens when the EOF has been seen but there's still
  271.      * some text process
  272.      */
  273. #define EOF_PENDING 1
  274. #define EOF_DONE 2
  275.     };
  276.  
  277. static YY_BUFFER_STATE yy_current_buffer;
  278.  
  279. /* we provide macros for accessing buffer states in case in the
  280.  * future we want to put the buffer states in a more general
  281.  * "scanner state"
  282.  */
  283. #define YY_CURRENT_BUFFER yy_current_buffer
  284.  
  285.  
  286. /* yy_hold_char holds the character lost when yytext is formed */
  287. static YY_CHAR yy_hold_char;
  288.  
  289. static int yy_n_chars;        /* number of characters read into yy_ch_buf */
  290.  
  291.  
  292.  
  293. #ifndef YY_USER_ACTION
  294. #define YY_USER_ACTION
  295. #endif
  296.  
  297. #ifndef YY_USER_INIT
  298. #define YY_USER_INIT
  299. #endif
  300.  
  301. extern YY_CHAR *yytext;
  302. extern int yyleng;
  303. extern FILE *yyin, *yyout;
  304.  
  305. YY_CHAR *yytext;
  306. int yyleng;
  307.  
  308. FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
  309.  
  310. #define YY_END_OF_BUFFER 40
  311. typedef int yy_state_type;
  312. static const short int yy_accept[144] =
  313.     {   0,
  314.         0,    0,   40,   38,   33,   31,   25,   38,   26,   38,
  315.        22,   26,   22,   22,   38,   26,   37,   29,   27,   29,
  316.        38,   22,   35,   35,   35,   35,   35,   35,   35,   35,
  317.        35,   35,   35,   35,   35,   35,   35,   35,   38,   33,
  318.        29,    0,   36,   27,   23,   30,   37,    0,   34,   37,
  319.        37,    0,   28,   32,   35,   35,   35,   35,   35,   35,
  320.        35,   35,   35,    7,   35,   35,   35,   35,   35,   35,
  321.        35,   35,   35,   35,   35,   24,   37,    0,    0,   37,
  322.         0,   35,   35,   35,   35,   35,    6,   35,   35,   35,
  323.        35,   35,   35,   35,   35,   35,   35,   35,   35,   35,
  324.  
  325.        35,   13,   35,   35,   35,   14,   16,   35,   17,   35,
  326.        35,   35,   35,    3,   15,   35,   35,    9,   35,   35,
  327.         2,   35,   35,   11,   35,   35,   12,   20,   35,   10,
  328.        35,    8,   35,    1,    4,   21,    5,   35,   35,   35,
  329.        19,   18,    0
  330.     } ;
  331.  
  332. static const YY_CHAR yy_ec[256] =
  333.     {   0,
  334.         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
  335.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  336.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  337.         1,    2,    4,    5,    1,    1,    6,    7,    1,    8,
  338.         9,   10,   11,   12,   13,   14,   15,   16,   16,   16,
  339.        16,   16,   16,   16,   16,   16,   16,    1,   17,   18,
  340.        19,   20,    1,    1,   21,   21,   21,   21,   21,   21,
  341.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  342.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  343.        22,   23,   24,   25,   26,    1,   27,   28,   29,   30,
  344.  
  345.        31,   32,   33,   34,   35,   36,   37,   38,   39,   40,
  346.        41,   42,   43,   44,   45,   46,   47,   36,   48,   36,
  347.        49,   36,   50,   51,   52,    1,    1,    1,    1,    1,
  348.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  349.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  350.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  351.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  352.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  353.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  354.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  355.  
  356.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  357.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  358.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  359.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  360.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  361.         1,    1,    1,    1,    1
  362.     } ;
  363.  
  364. static const YY_CHAR yy_meta[53] =
  365.     {   0,
  366.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  367.         1,    1,    1,    1,    1,    2,    1,    1,    1,    1,
  368.         1,    1,    1,    1,    1,    2,    2,    2,    2,    2,
  369.         2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
  370.         2,    2,    2,    2,    2,    2,    2,    2,    2,    1,
  371.         1,    1
  372.     } ;
  373.  
  374. static const short int yy_base[146] =
  375.     {   0,
  376.         0,    0,  193,  194,  190,  194,  172,  185,  170,  181,
  377.       194,  168,   42,   41,   41,   46,   52,  167,   61,  166,
  378.       181,  164,  135,  137,  139,  148,  140,  136,    0,  149,
  379.        27,   50,  147,  130,  126,  141,   40,   36,  120,  168,
  380.       194,  164,  194,  194,  194,  194,   66,  165,  194,   72,
  381.        76,  164,  194,  194,    0,  120,  134,  124,  131,  117,
  382.       117,  122,  132,    0,  113,  117,  117,  128,  119,  118,
  383.        52,  125,  107,  106,  114,  194,   80,  145,   84,   88,
  384.       144,  105,  118,   98,  108,  111,    0,   95,   95,   93,
  385.       105,  102,   91,   95,   88,  103,   85,   93,   84,   85,
  386.  
  387.        90,    0,   90,   91,   85,    0,    0,   93,    0,   77,
  388.        76,   90,   74,    0,    0,   75,   87,    0,   90,   85,
  389.         0,   75,   83,    0,   76,   63,    0,    0,   66,    0,
  390.        62,    0,   47,    0,    0,    0,    0,   45,   53,   29,
  391.         0,    0,  194,  111,   56
  392.     } ;
  393.  
  394. static const short int yy_def[146] =
  395.     {   0,
  396.       143,    1,  143,  143,  143,  143,  143,  144,  143,  143,
  397.       143,  143,  143,  143,  143,  143,  143,  143,  143,  143,
  398.       143,  143,  145,  145,  145,  145,  145,  145,  145,  145,
  399.       145,  145,  145,  145,  145,  145,  145,  145,  143,  143,
  400.       143,  144,  143,  143,  143,  143,  143,  143,  143,  143,
  401.       143,  143,  143,  143,  145,  145,  145,  145,  145,  145,
  402.       145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
  403.       145,  145,  145,  145,  145,  143,  143,  143,  143,  143,
  404.       143,  145,  145,  145,  145,  145,  145,  145,  145,  145,
  405.       145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
  406.  
  407.       145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
  408.       145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
  409.       145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
  410.       145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
  411.       145,  145,    0,  143,  143
  412.     } ;
  413.  
  414. static const short int yy_nxt[247] =
  415.     {   0,
  416.         4,    5,    6,    7,    8,    9,   10,   11,   11,   12,
  417.        13,   11,   14,   15,   16,   17,   11,   18,   19,   20,
  418.        17,   11,   21,   11,   22,    4,   23,   24,   25,   26,
  419.        27,   28,   29,   30,   31,   29,   29,   32,   29,   29,
  420.        33,   34,   35,   36,   37,   29,   29,   38,   29,   11,
  421.        39,   11,   46,   46,   63,   49,   47,   55,   64,   44,
  422.        44,   47,   74,   48,   44,   50,   53,   51,   72,   75,
  423.        53,   53,   51,   53,   52,   53,   65,  142,   96,   41,
  424.        66,   77,   73,  141,   67,   53,   77,   80,   78,   50,
  425.       140,   51,   80,  139,   81,   77,   51,   97,   52,   47,
  426.  
  427.        77,  138,   78,   80,   47,  137,   48,  136,   80,  135,
  428.        81,   42,   42,  134,  133,  132,  131,  130,  129,  128,
  429.       127,  126,  125,  124,  123,  122,  121,  120,  119,  118,
  430.       117,  116,  115,  114,  113,  112,  111,  110,  109,  108,
  431.       107,  106,  105,  104,  103,  102,   80,   77,  101,  100,
  432.        99,   98,   95,   94,   93,   92,   91,   90,   89,   88,
  433.        87,   86,   85,   84,   83,   82,   51,   79,   43,   40,
  434.        76,   71,   70,   69,   68,   62,   61,   60,   59,   58,
  435.        57,   56,   44,   54,   41,   41,   44,   45,   44,   43,
  436.        41,   40,  143,    3,  143,  143,  143,  143,  143,  143,
  437.  
  438.       143,  143,  143,  143,  143,  143,  143,  143,  143,  143,
  439.       143,  143,  143,  143,  143,  143,  143,  143,  143,  143,
  440.       143,  143,  143,  143,  143,  143,  143,  143,  143,  143,
  441.       143,  143,  143,  143,  143,  143,  143,  143,  143,  143,
  442.       143,  143,  143,  143,  143,  143
  443.     } ;
  444.  
  445. static const short int yy_chk[247] =
  446.     {   0,
  447.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  448.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  449.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  450.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  451.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  452.         1,    1,   13,   14,   31,   16,   15,  145,   31,   14,
  453.        13,   15,   38,   15,   16,   17,   19,   17,   37,   38,
  454.        19,   19,   17,   19,   17,   19,   32,  140,   71,   19,
  455.        32,   47,   37,  139,   32,   19,   47,   50,   47,   51,
  456.       138,   51,   50,  133,   50,   77,   51,   71,   51,   79,
  457.  
  458.        77,  131,   77,   80,   79,  129,   79,  126,   80,  125,
  459.        80,  144,  144,  123,  122,  120,  119,  117,  116,  113,
  460.       112,  111,  110,  108,  105,  104,  103,  101,  100,   99,
  461.        98,   97,   96,   95,   94,   93,   92,   91,   90,   89,
  462.        88,   86,   85,   84,   83,   82,   81,   78,   75,   74,
  463.        73,   72,   70,   69,   68,   67,   66,   65,   63,   62,
  464.        61,   60,   59,   58,   57,   56,   52,   48,   42,   40,
  465.        39,   36,   35,   34,   33,   30,   28,   27,   26,   25,
  466.        24,   23,   22,   21,   20,   18,   12,   10,    9,    8,
  467.         7,    5,    3,  143,  143,  143,  143,  143,  143,  143,
  468.  
  469.       143,  143,  143,  143,  143,  143,  143,  143,  143,  143,
  470.       143,  143,  143,  143,  143,  143,  143,  143,  143,  143,
  471.       143,  143,  143,  143,  143,  143,  143,  143,  143,  143,
  472.       143,  143,  143,  143,  143,  143,  143,  143,  143,  143,
  473.       143,  143,  143,  143,  143,  143
  474.     } ;
  475.  
  476. static yy_state_type yy_last_accepting_state;
  477. static YY_CHAR *yy_last_accepting_cpos;
  478.  
  479. /* the intent behind this definition is that it'll catch
  480.  * any uses of REJECT which flex missed
  481.  */
  482. #define REJECT reject_used_but_not_detected
  483. #define yymore() yymore_used_but_not_detected
  484. #define YY_MORE_ADJ 0
  485.  
  486. /* these variables are all declared out here so that section 3 code can
  487.  * manipulate them
  488.  */
  489. /* points to current character in buffer */
  490. static YY_CHAR *yy_c_buf_p = (YY_CHAR *) 0;
  491. static int yy_init = 1;        /* whether we need to initialize */
  492. static int yy_start = 0;    /* start state number */
  493.  
  494. /* flag which is used to allow yywrap()'s to do buffer switches
  495.  * instead of setting up a fresh yyin.  A bit of a hack ...
  496.  */
  497. static int yy_did_buffer_switch_on_eof;
  498.  
  499. static yy_state_type yy_get_previous_state YY_PROTO(( void ));
  500. static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
  501. static int yy_get_next_buffer YY_PROTO(( void ));
  502. static void yyunput YY_PROTO(( YY_CHAR c, YY_CHAR *buf_ptr ));
  503. void yyrestart YY_PROTO(( FILE *input_file ));
  504. void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
  505. void yy_load_buffer_state YY_PROTO(( void ));
  506. YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
  507. void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
  508. void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
  509.  
  510. #define yy_new_buffer yy_create_buffer
  511.  
  512. #ifdef __cplusplus
  513. static int yyinput YY_PROTO(( void ));
  514. #else
  515. static int input YY_PROTO(( void ));
  516. #endif
  517.  
  518. YY_DECL
  519.     {
  520.     register yy_state_type yy_current_state;
  521.     register YY_CHAR *yy_cp, *yy_bp;
  522.     register int yy_act;
  523.  
  524.  
  525.  
  526.     if ( yy_init )
  527.     {
  528.     YY_USER_INIT;
  529.  
  530.     if ( ! yy_start )
  531.         yy_start = 1;    /* first start state */
  532.  
  533.     if ( ! yyin )
  534.         yyin = stdin;
  535.  
  536.     if ( ! yyout )
  537.         yyout = stdout;
  538.  
  539.     if ( yy_current_buffer )
  540.         yy_init_buffer( yy_current_buffer, yyin );
  541.     else
  542.         yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
  543.  
  544.     yy_load_buffer_state();
  545.  
  546.     yy_init = 0;
  547.     }
  548.  
  549.     while ( 1 )        /* loops until end-of-file is reached */
  550.     {
  551.     yy_cp = yy_c_buf_p;
  552.  
  553.     /* support of yytext */
  554.     *yy_cp = yy_hold_char;
  555.  
  556.     /* yy_bp points to the position in yy_ch_buf of the start of the
  557.      * current run.
  558.      */
  559.     yy_bp = yy_cp;
  560.  
  561.     yy_current_state = yy_start;
  562. yy_match:
  563.     do
  564.         {
  565.         register YY_CHAR yy_c = yy_ec[*yy_cp];
  566.         if ( yy_accept[yy_current_state] )
  567.         {
  568.         yy_last_accepting_state = yy_current_state;
  569.         yy_last_accepting_cpos = yy_cp;
  570.         }
  571.         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  572.         {
  573.         yy_current_state = yy_def[yy_current_state];
  574.         if ( yy_current_state >= 144 )
  575.             yy_c = yy_meta[yy_c];
  576.         }
  577.         yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  578.         ++yy_cp;
  579.         }
  580.     while ( yy_base[yy_current_state] != 194 );
  581.  
  582. yy_find_action:
  583.     yy_act = yy_accept[yy_current_state];
  584.  
  585.     YY_DO_BEFORE_ACTION;
  586.     YY_USER_ACTION;
  587.  
  588. do_action:    /* this label is used only to access EOF actions */
  589.  
  590.  
  591.     switch ( yy_act )
  592.         {
  593.         case 0: /* must backtrack */
  594.         /* undo the effects of YY_DO_BEFORE_ACTION */
  595.         *yy_cp = yy_hold_char;
  596.         yy_cp = yy_last_accepting_cpos;
  597.         yy_current_state = yy_last_accepting_state;
  598.         goto yy_find_action;
  599.  
  600. case 1:
  601. # line 61 "scan.l"
  602. return(Define);
  603.     YY_BREAK
  604. case 2:
  605. # line 62 "scan.l"
  606. return(Break);
  607.     YY_BREAK
  608. case 3:
  609. # line 63 "scan.l"
  610. return(Quit);
  611.     YY_BREAK
  612. case 4:
  613. # line 64 "scan.l"
  614. return(Length);
  615.     YY_BREAK
  616. case 5:
  617. # line 65 "scan.l"
  618. return(Return);
  619.     YY_BREAK
  620. case 6:
  621. # line 66 "scan.l"
  622. return(For);
  623.     YY_BREAK
  624. case 7:
  625. # line 67 "scan.l"
  626. return(If);
  627.     YY_BREAK
  628. case 8:
  629. # line 68 "scan.l"
  630. return(While);
  631.     YY_BREAK
  632. case 9:
  633. # line 69 "scan.l"
  634. return(Sqrt);
  635.     YY_BREAK
  636. case 10:
  637. # line 70 "scan.l"
  638. return(Scale);
  639.     YY_BREAK
  640. case 11:
  641. # line 71 "scan.l"
  642. return(Ibase);
  643.     YY_BREAK
  644. case 12:
  645. # line 72 "scan.l"
  646. return(Obase);
  647.     YY_BREAK
  648. case 13:
  649. # line 73 "scan.l"
  650. return(Auto);
  651.     YY_BREAK
  652. case 14:
  653. # line 74 "scan.l"
  654. return(Else);
  655.     YY_BREAK
  656. case 15:
  657. # line 75 "scan.l"
  658. return(Read);
  659.     YY_BREAK
  660. case 16:
  661. # line 76 "scan.l"
  662. return(Halt);
  663.     YY_BREAK
  664. case 17:
  665. # line 77 "scan.l"
  666. return(Last);
  667.     YY_BREAK
  668. case 18:
  669. # line 78 "scan.l"
  670. return(Warranty);
  671.     YY_BREAK
  672. case 19:
  673. # line 79 "scan.l"
  674. return(Continue);
  675.     YY_BREAK
  676. case 20:
  677. # line 80 "scan.l"
  678. return(Print);
  679.     YY_BREAK
  680. case 21:
  681. # line 81 "scan.l"
  682. return(Limits);
  683.     YY_BREAK
  684. case 22:
  685. # line 82 "scan.l"
  686. { yylval.c_value = yytext[0]; 
  687.                           return((int)yytext[0]); }
  688.     YY_BREAK
  689. case 23:
  690. # line 84 "scan.l"
  691. { return(AND); }
  692.     YY_BREAK
  693. case 24:
  694. # line 85 "scan.l"
  695. { return(OR); }
  696.     YY_BREAK
  697. case 25:
  698. # line 86 "scan.l"
  699. { return(NOT); }
  700.     YY_BREAK
  701. case 26:
  702. # line 87 "scan.l"
  703. { yylval.c_value = yytext[0]; return(MUL_OP); }
  704.     YY_BREAK
  705. case 27:
  706. # line 88 "scan.l"
  707. { yylval.c_value = yytext[0]; return(ASSIGN_OP); }
  708.     YY_BREAK
  709. case 28:
  710. # line 89 "scan.l"
  711. #ifdef OLD_EQ_OP
  712.              char warn_save;
  713.              warn_save = warn_not_std;
  714.              warn_not_std = TRUE;
  715.              warn ("Old fashioned =<op>");
  716.              warn_not_std = warn_save;
  717.              yylval.c_value = yytext[1];
  718. #else
  719.              yylval.c_value = '=';
  720.              yyless (1);
  721. #endif
  722.              return(ASSIGN_OP);
  723.                }
  724.     YY_BREAK
  725. case 29:
  726. # line 103 "scan.l"
  727. { yylval.s_value = strcopyof(yytext); return(REL_OP); }
  728.     YY_BREAK
  729. case 30:
  730. # line 104 "scan.l"
  731. { yylval.c_value = yytext[0]; return(INCR_DECR); }
  732.     YY_BREAK
  733. case 31:
  734. # line 105 "scan.l"
  735. { line_no++; return(NEWLINE); }
  736.     YY_BREAK
  737. case 32:
  738. # line 106 "scan.l"
  739. {  line_no++;  /* ignore a "quoted" newline */ }
  740.     YY_BREAK
  741. case 33:
  742. # line 107 "scan.l"
  743. { /* ignore spaces and tabs */ }
  744.     YY_BREAK
  745. case 34:
  746. # line 108 "scan.l"
  747. {
  748.     int c;
  749.  
  750.     for (;;)
  751.       {
  752.         while ( ((c=input()) != '*') && (c != EOF)) 
  753.           /* eat it */
  754.           if (c == '\n') line_no++;
  755.         if (c == '*')
  756.            {
  757.         while ( (c=input()) == '*') /* eat it*/;
  758.         if (c == '/') break; /* at end of comment */
  759.         if (c == '\n') line_no++;
  760.           }
  761.         if (c == EOF)
  762.           {
  763.         fprintf (stderr,"EOF encountered in a comment.\n");
  764.         break;
  765.           }
  766.       }
  767.       }
  768.     YY_BREAK
  769. case 35:
  770. # line 129 "scan.l"
  771. { yylval.s_value = strcopyof(yytext); return(NAME); }
  772.     YY_BREAK
  773. case 36:
  774. # line 130 "scan.l"
  775. {
  776.            unsigned char *look;
  777.           int count = 0;
  778.           yylval.s_value = strcopyof(yytext);
  779.           for (look = yytext; *look != 0; look++)
  780.         {
  781.           if (*look == '\n') line_no++;
  782.           if (*look == '"')  count++;
  783.         }
  784.           if (count != 2) yyerror ("NUL character in string.");
  785.           return(STRING);
  786.         }
  787.     YY_BREAK
  788. case 37:
  789. # line 142 "scan.l"
  790. {
  791.           unsigned char *src, *dst;
  792.           int len;
  793.           /* remove a trailing decimal point. */
  794.           len = strlen(yytext);
  795.           if (yytext[len-1] == '.')
  796.             yytext[len-1] = 0;
  797.           /* remove leading zeros. */
  798.           src = yytext;
  799.           dst = yytext;
  800.           while (*src == '0') src++;
  801.           if (*src == 0) src--;
  802.           /* Copy strings removing the newlines. */
  803.           while (*src != 0)
  804.         {
  805.               if (*src == '\\')
  806.             {
  807.               src++; src++;
  808.               line_no++;
  809.             }
  810.           else
  811.             *dst++ = *src++;
  812.             }
  813.           *dst = 0;
  814.           yylval.s_value = strcopyof(yytext); 
  815.           return(NUMBER);
  816.         }
  817.     YY_BREAK
  818. case 38:
  819. # line 169 "scan.l"
  820. {
  821.       if (yytext[0] < ' ')
  822.         yyerror ("illegal character: ^%c",yytext[0] + '@');
  823.       else
  824.         if (yytext[0] > '~')
  825.           yyerror ("illegal character: \\%3d", (int) yytext[0]);
  826.         else
  827.           yyerror ("illegal character: %s",yytext);
  828.     }
  829.     YY_BREAK
  830. case 39:
  831. # line 178 "scan.l"
  832. ECHO;
  833.     YY_BREAK
  834. case YY_STATE_EOF(INITIAL):
  835.     yyterminate();
  836.  
  837.         case YY_END_OF_BUFFER:
  838.         {
  839.         /* amount of text matched not including the EOB char */
  840.         int yy_amount_of_matched_text = yy_cp - yytext - 1;
  841.  
  842.         /* undo the effects of YY_DO_BEFORE_ACTION */
  843.         *yy_cp = yy_hold_char;
  844.  
  845.         /* note that here we test for yy_c_buf_p "<=" to the position
  846.          * of the first EOB in the buffer, since yy_c_buf_p will
  847.          * already have been incremented past the NUL character
  848.          * (since all states make transitions on EOB to the end-
  849.          * of-buffer state).  Contrast this with the test in yyinput().
  850.          */
  851.         if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  852.             /* this was really a NUL */
  853.             {
  854.             yy_state_type yy_next_state;
  855.  
  856.             yy_c_buf_p = yytext + yy_amount_of_matched_text;
  857.  
  858.             yy_current_state = yy_get_previous_state();
  859.  
  860.             /* okay, we're now positioned to make the
  861.              * NUL transition.  We couldn't have
  862.              * yy_get_previous_state() go ahead and do it
  863.              * for us because it doesn't know how to deal
  864.              * with the possibility of jamming (and we
  865.              * don't want to build jamming into it because
  866.              * then it will run more slowly)
  867.              */
  868.  
  869.             yy_next_state = yy_try_NUL_trans( yy_current_state );
  870.  
  871.             yy_bp = yytext + YY_MORE_ADJ;
  872.  
  873.             if ( yy_next_state )
  874.             {
  875.             /* consume the NUL */
  876.             yy_cp = ++yy_c_buf_p;
  877.             yy_current_state = yy_next_state;
  878.             goto yy_match;
  879.             }
  880.  
  881.             else
  882.             {
  883.             goto yy_find_action;
  884.             }
  885.             }
  886.  
  887.         else switch ( yy_get_next_buffer() )
  888.             {
  889.             case EOB_ACT_END_OF_FILE:
  890.             {
  891.             yy_did_buffer_switch_on_eof = 0;
  892.  
  893.             if ( yywrap() )
  894.                 {
  895.                 /* note: because we've taken care in
  896.                  * yy_get_next_buffer() to have set up yytext,
  897.                  * we can now set up yy_c_buf_p so that if some
  898.                  * total hoser (like flex itself) wants
  899.                  * to call the scanner after we return the
  900.                  * YY_NULL, it'll still work - another YY_NULL
  901.                  * will get returned.
  902.                  */
  903.                 yy_c_buf_p = yytext + YY_MORE_ADJ;
  904.  
  905.                 yy_act = YY_STATE_EOF((yy_start - 1) / 2);
  906.                 goto do_action;
  907.                 }
  908.  
  909.             else
  910.                 {
  911.                 if ( ! yy_did_buffer_switch_on_eof )
  912.                 YY_NEW_FILE;
  913.                 }
  914.             }
  915.             break;
  916.  
  917.             case EOB_ACT_CONTINUE_SCAN:
  918.             yy_c_buf_p = yytext + yy_amount_of_matched_text;
  919.  
  920.             yy_current_state = yy_get_previous_state();
  921.  
  922.             yy_cp = yy_c_buf_p;
  923.             yy_bp = yytext + YY_MORE_ADJ;
  924.             goto yy_match;
  925.  
  926.             case EOB_ACT_LAST_MATCH:
  927.             yy_c_buf_p =
  928.                 &yy_current_buffer->yy_ch_buf[yy_n_chars];
  929.  
  930.             yy_current_state = yy_get_previous_state();
  931.  
  932.             yy_cp = yy_c_buf_p;
  933.             yy_bp = yytext + YY_MORE_ADJ;
  934.             goto yy_find_action;
  935.             }
  936.         break;
  937.         }
  938.  
  939.         default:
  940. #ifdef FLEX_DEBUG
  941.         printf( "action # %d\n", yy_act );
  942. #endif
  943.         YY_FATAL_ERROR(
  944.             "fatal flex scanner internal error--no action found" );
  945.         }
  946.     }
  947.     }
  948.  
  949.  
  950. /* yy_get_next_buffer - try to read in a new buffer
  951.  *
  952.  * synopsis
  953.  *     int yy_get_next_buffer();
  954.  *     
  955.  * returns a code representing an action
  956.  *     EOB_ACT_LAST_MATCH - 
  957.  *     EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  958.  *     EOB_ACT_END_OF_FILE - end of file
  959.  */
  960.  
  961. static int yy_get_next_buffer()
  962.  
  963.     {
  964.     register YY_CHAR *dest = yy_current_buffer->yy_ch_buf;
  965.     register YY_CHAR *source = yytext - 1; /* copy prev. char, too */
  966.     register int number_to_move, i;
  967.     int ret_val;
  968.  
  969.     if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
  970.     YY_FATAL_ERROR(
  971.         "fatal flex scanner internal error--end of buffer missed" );
  972.  
  973.     /* try to read more data */
  974.  
  975.     /* first move last chars to start of buffer */
  976.     number_to_move = yy_c_buf_p - yytext;
  977.  
  978.     for ( i = 0; i < number_to_move; ++i )
  979.     *(dest++) = *(source++);
  980.  
  981.     if ( yy_current_buffer->yy_eof_status != EOF_NOT_SEEN )
  982.     /* don't do the read, it's not guaranteed to return an EOF,
  983.      * just force an EOF
  984.      */
  985.     yy_n_chars = 0;
  986.  
  987.     else
  988.     {
  989.     int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1;
  990.  
  991.     if ( num_to_read > YY_READ_BUF_SIZE )
  992.         num_to_read = YY_READ_BUF_SIZE;
  993.  
  994.     else if ( num_to_read <= 0 )
  995.         YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" );
  996.  
  997.     /* read in more data */
  998.     YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
  999.           yy_n_chars, num_to_read );
  1000.     }
  1001.  
  1002.     if ( yy_n_chars == 0 )
  1003.     {
  1004.     if ( number_to_move == 1 )
  1005.         {
  1006.         ret_val = EOB_ACT_END_OF_FILE;
  1007.         yy_current_buffer->yy_eof_status = EOF_DONE;
  1008.         }
  1009.  
  1010.     else
  1011.         {
  1012.         ret_val = EOB_ACT_LAST_MATCH;
  1013.         yy_current_buffer->yy_eof_status = EOF_PENDING;
  1014.         }
  1015.     }
  1016.  
  1017.     else
  1018.     ret_val = EOB_ACT_CONTINUE_SCAN;
  1019.  
  1020.     yy_n_chars += number_to_move;
  1021.     yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  1022.     yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  1023.  
  1024.     /* yytext begins at the second character in yy_ch_buf; the first
  1025.      * character is the one which preceded it before reading in the latest
  1026.      * buffer; it needs to be kept around in case it's a newline, so
  1027.      * yy_get_previous_state() will have with '^' rules active
  1028.      */
  1029.  
  1030.     yytext = &yy_current_buffer->yy_ch_buf[1];
  1031.  
  1032.     return ( ret_val );
  1033.     }
  1034.  
  1035.  
  1036. /* yy_get_previous_state - get the state just before the EOB char was reached
  1037.  *
  1038.  * synopsis
  1039.  *     yy_state_type yy_get_previous_state();
  1040.  */
  1041.  
  1042. static yy_state_type yy_get_previous_state()
  1043.  
  1044.     {
  1045.     register yy_state_type yy_current_state;
  1046.     register YY_CHAR *yy_cp;
  1047.  
  1048.     yy_current_state = yy_start;
  1049.  
  1050.     for ( yy_cp = yytext + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
  1051.     {
  1052.     register YY_CHAR yy_c = (*yy_cp ? yy_ec[*yy_cp] : 1);
  1053.     if ( yy_accept[yy_current_state] )
  1054.         {
  1055.         yy_last_accepting_state = yy_current_state;
  1056.         yy_last_accepting_cpos = yy_cp;
  1057.         }
  1058.     while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1059.         {
  1060.         yy_current_state = yy_def[yy_current_state];
  1061.         if ( yy_current_state >= 144 )
  1062.         yy_c = yy_meta[yy_c];
  1063.         }
  1064.     yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  1065.     }
  1066.  
  1067.     return ( yy_current_state );
  1068.     }
  1069.  
  1070.  
  1071. /* yy_try_NUL_trans - try to make a transition on the NUL character
  1072.  *
  1073.  * synopsis
  1074.  *     next_state = yy_try_NUL_trans( current_state );
  1075.  */
  1076.  
  1077. #ifdef YY_USE_PROTOS
  1078. static yy_state_type yy_try_NUL_trans( register yy_state_type yy_current_state )
  1079. #else
  1080. static yy_state_type yy_try_NUL_trans( yy_current_state )
  1081. register yy_state_type yy_current_state;
  1082. #endif
  1083.  
  1084.     {
  1085.     register int yy_is_jam;
  1086.     register YY_CHAR *yy_cp = yy_c_buf_p;
  1087.  
  1088.     register YY_CHAR yy_c = 1;
  1089.     if ( yy_accept[yy_current_state] )
  1090.     {
  1091.     yy_last_accepting_state = yy_current_state;
  1092.     yy_last_accepting_cpos = yy_cp;
  1093.     }
  1094.     while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1095.     {
  1096.     yy_current_state = yy_def[yy_current_state];
  1097.     if ( yy_current_state >= 144 )
  1098.         yy_c = yy_meta[yy_c];
  1099.     }
  1100.     yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  1101.     yy_is_jam = (yy_current_state == 143);
  1102.  
  1103.     return ( yy_is_jam ? 0 : yy_current_state );
  1104.     }
  1105.  
  1106.  
  1107. #ifdef YY_USE_PROTOS
  1108. static void yyunput( YY_CHAR c, register YY_CHAR *yy_bp )
  1109. #else
  1110. static void yyunput( c, yy_bp )
  1111. YY_CHAR c;
  1112. register YY_CHAR *yy_bp;
  1113. #endif
  1114.  
  1115.     {
  1116.     register YY_CHAR *yy_cp = yy_c_buf_p;
  1117.  
  1118.     /* undo effects of setting up yytext */
  1119.     *yy_cp = yy_hold_char;
  1120.  
  1121.     if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  1122.     { /* need to shift things up to make room */
  1123.     register int number_to_move = yy_n_chars + 2; /* +2 for EOB chars */
  1124.     register YY_CHAR *dest =
  1125.         &yy_current_buffer->yy_ch_buf[yy_current_buffer->yy_buf_size + 2];
  1126.     register YY_CHAR *source =
  1127.         &yy_current_buffer->yy_ch_buf[number_to_move];
  1128.  
  1129.     while ( source > yy_current_buffer->yy_ch_buf )
  1130.         *--dest = *--source;
  1131.  
  1132.     yy_cp += dest - source;
  1133.     yy_bp += dest - source;
  1134.     yy_n_chars = yy_current_buffer->yy_buf_size;
  1135.  
  1136.     if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  1137.         YY_FATAL_ERROR( "flex scanner push-back overflow" );
  1138.     }
  1139.  
  1140.     if ( yy_cp > yy_bp && yy_cp[-1] == '\n' )
  1141.     yy_cp[-2] = '\n';
  1142.  
  1143.     *--yy_cp = c;
  1144.  
  1145.     /* note: the formal parameter *must* be called "yy_bp" for this
  1146.      *       macro to now work correctly
  1147.      */
  1148.     YY_DO_BEFORE_ACTION; /* set up yytext again */
  1149.     }
  1150.  
  1151.  
  1152. #ifdef __cplusplus
  1153. static int yyinput()
  1154. #else
  1155. static int input()
  1156. #endif
  1157.  
  1158.     {
  1159.     int c;
  1160.     YY_CHAR *yy_cp = yy_c_buf_p;
  1161.  
  1162.     *yy_cp = yy_hold_char;
  1163.  
  1164.     if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
  1165.     {
  1166.     /* yy_c_buf_p now points to the character we want to return.
  1167.      * If this occurs *before* the EOB characters, then it's a
  1168.      * valid NUL; if not, then we've hit the end of the buffer.
  1169.      */
  1170.     if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  1171.         /* this was really a NUL */
  1172.         *yy_c_buf_p = '\0';
  1173.  
  1174.     else
  1175.         { /* need more input */
  1176.         yytext = yy_c_buf_p;
  1177.         ++yy_c_buf_p;
  1178.  
  1179.         switch ( yy_get_next_buffer() )
  1180.         {
  1181.         case EOB_ACT_END_OF_FILE:
  1182.             {
  1183.             if ( yywrap() )
  1184.             {
  1185.             yy_c_buf_p = yytext + YY_MORE_ADJ;
  1186.             return ( EOF );
  1187.             }
  1188.  
  1189.             YY_NEW_FILE;
  1190.  
  1191. #ifdef __cplusplus
  1192.             return ( yyinput() );
  1193. #else
  1194.             return ( input() );
  1195. #endif
  1196.             }
  1197.             break;
  1198.  
  1199.         case EOB_ACT_CONTINUE_SCAN:
  1200.             yy_c_buf_p = yytext + YY_MORE_ADJ;
  1201.             break;
  1202.  
  1203.         case EOB_ACT_LAST_MATCH:
  1204. #ifdef __cplusplus
  1205.             YY_FATAL_ERROR( "unexpected last match in yyinput()" );
  1206. #else
  1207.             YY_FATAL_ERROR( "unexpected last match in input()" );
  1208. #endif
  1209.         }
  1210.         }
  1211.     }
  1212.  
  1213.     c = *yy_c_buf_p;
  1214.     yy_hold_char = *++yy_c_buf_p;
  1215.  
  1216.     return ( c );
  1217.     }
  1218.  
  1219.  
  1220. #ifdef YY_USE_PROTOS
  1221. void yyrestart( FILE *input_file )
  1222. #else
  1223. void yyrestart( input_file )
  1224. FILE *input_file;
  1225. #endif
  1226.  
  1227.     {
  1228.     yy_init_buffer( yy_current_buffer, input_file );
  1229.     yy_load_buffer_state();
  1230.     }
  1231.  
  1232.  
  1233. #ifdef YY_USE_PROTOS
  1234. void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
  1235. #else
  1236. void yy_switch_to_buffer( new_buffer )
  1237. YY_BUFFER_STATE new_buffer;
  1238. #endif
  1239.  
  1240.     {
  1241.     if ( yy_current_buffer == new_buffer )
  1242.     return;
  1243.  
  1244.     if ( yy_current_buffer )
  1245.     {
  1246.     /* flush out information for old buffer */
  1247.     *yy_c_buf_p = yy_hold_char;
  1248.     yy_current_buffer->yy_buf_pos = yy_c_buf_p;
  1249.     yy_current_buffer->yy_n_chars = yy_n_chars;
  1250.     }
  1251.  
  1252.     yy_current_buffer = new_buffer;
  1253.     yy_load_buffer_state();
  1254.  
  1255.     /* we don't actually know whether we did this switch during
  1256.      * EOF (yywrap()) processing, but the only time this flag
  1257.      * is looked at is after yywrap() is called, so it's safe
  1258.      * to go ahead and always set it.
  1259.      */
  1260.     yy_did_buffer_switch_on_eof = 1;
  1261.     }
  1262.  
  1263.  
  1264. #ifdef YY_USE_PROTOS
  1265. void yy_load_buffer_state( void )
  1266. #else
  1267. void yy_load_buffer_state()
  1268. #endif
  1269.  
  1270.     {
  1271.     yy_n_chars = yy_current_buffer->yy_n_chars;
  1272.     yytext = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
  1273.     yyin = yy_current_buffer->yy_input_file;
  1274.     yy_hold_char = *yy_c_buf_p;
  1275.     }
  1276.  
  1277.  
  1278. #ifdef YY_USE_PROTOS
  1279. YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
  1280. #else
  1281. YY_BUFFER_STATE yy_create_buffer( file, size )
  1282. FILE *file;
  1283. int size;
  1284. #endif
  1285.  
  1286.     {
  1287.     YY_BUFFER_STATE b;
  1288.  
  1289.     b = (YY_BUFFER_STATE) malloc( sizeof( struct yy_buffer_state ) );
  1290.  
  1291.     if ( ! b )
  1292.     YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1293.  
  1294.     b->yy_buf_size = size;
  1295.  
  1296.     /* yy_ch_buf has to be 2 characters longer than the size given because
  1297.      * we need to put in 2 end-of-buffer characters.
  1298.      */
  1299.     b->yy_ch_buf = (YY_CHAR *) malloc( (unsigned) (b->yy_buf_size + 2) );
  1300.  
  1301.     if ( ! b->yy_ch_buf )
  1302.     YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1303.  
  1304.     yy_init_buffer( b, file );
  1305.  
  1306.     return ( b );
  1307.     }
  1308.  
  1309.  
  1310. #ifdef YY_USE_PROTOS
  1311. void yy_delete_buffer( YY_BUFFER_STATE b )
  1312. #else
  1313. void yy_delete_buffer( b )
  1314. YY_BUFFER_STATE b;
  1315. #endif
  1316.  
  1317.     {
  1318.     if ( b == yy_current_buffer )
  1319.     yy_current_buffer = (YY_BUFFER_STATE) 0;
  1320.  
  1321.     free( (char *) b->yy_ch_buf );
  1322.     free( (char *) b );
  1323.     }
  1324.  
  1325.  
  1326. #ifdef YY_USE_PROTOS
  1327. void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
  1328. #else
  1329. void yy_init_buffer( b, file )
  1330. YY_BUFFER_STATE b;
  1331. FILE *file;
  1332. #endif
  1333.  
  1334.     {
  1335.     b->yy_input_file = file;
  1336.  
  1337.     /* we put in the '\n' and start reading from [1] so that an
  1338.      * initial match-at-newline will be true.
  1339.      */
  1340.  
  1341.     b->yy_ch_buf[0] = '\n';
  1342.     b->yy_n_chars = 1;
  1343.  
  1344.     /* we always need two end-of-buffer characters.  The first causes
  1345.      * a transition to the end-of-buffer state.  The second causes
  1346.      * a jam in that state.
  1347.      */
  1348.     b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  1349.     b->yy_ch_buf[2] = YY_END_OF_BUFFER_CHAR;
  1350.  
  1351.     b->yy_buf_pos = &b->yy_ch_buf[1];
  1352.  
  1353.     b->yy_eof_status = EOF_NOT_SEEN;
  1354.     }
  1355. # line 178 "scan.l"
  1356.  
  1357.  
  1358.  
  1359.  
  1360. /* This is the way to get multiple files input into lex. */
  1361.  
  1362. int
  1363. yywrap()
  1364. {
  1365.   if (!open_new_file ()) return (1);    /* EOF on standard in. */
  1366.   return (0);                /* We have more input. */
  1367. }
  1368.